namespace Sundry.DAL.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class AddOperation : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Authories",
                c => new
                    {
                        AuthoryId = c.Int(nullable: false, identity: true),
                        Name = c.String(maxLength: 20),
                        MenuList = c.String(maxLength: 300),
                    })
                .PrimaryKey(t => t.AuthoryId);
            
            CreateTable(
                "dbo.AdminOperations",
                c => new
                    {
                        AdminOperationId = c.Int(nullable: false, identity: true),
                        AdminId = c.Int(nullable: false),
                        AuthoryId = c.Int(nullable: false),
                        Action = c.Int(nullable: false),
                        Title = c.String(maxLength: 15),
                        Content = c.String(maxLength: 200),
                        OperateIP = c.String(maxLength: 50),
                        OperateAddress = c.String(maxLength: 100),
                        CreateTime = c.DateTime(nullable: false),
                    })
                .PrimaryKey(t => t.AdminOperationId);
        }
        
        public override void Down()
        {
            DropForeignKey("dbo.Admins", "AuthoryId", "dbo.Authories");
            DropIndex("dbo.Admins", new[] { "AuthoryId" });
            DropTable("dbo.AdminOperations");
            DropTable("dbo.Authories");
        }
    }
}
